package org.matrix.basic
{
	import org.matrix.basic.Matrix2D;

	public final class Operator
	{
		public function Operator(){}
		
		public static function multiply(m1:IMatrix2D, m2:IMatrix2D):void
		{
		}
		
		public static function add(m1:IMatrix2D, m2:IMatrix2D):void
		{
			var r:uint;
			const rows:uint = m1.rows;
			for (var c:uint = m1.collums; c -- >= 1;)
			{
				for (r = rows; r -- >= 1;)
					m1.setElement(m1.getElement(c, r) + m2.getElement(c, r), c, r)
			}
		}
		
		public static function clone(m1:IMatrix2D):IMatrix2D
		{			
			const rows:uint = m1.rows;
			const collums:uint = m1.collums;
			const d2:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(collums, true);
			var r:uint;
			for (var c:uint = collums; c -- >= 1;)
			{
				for (r = rows; r -- >= 1;)
					d2[c][r] = m1.getElement(c, r);
			}
			return new Matrix2D(collums, rows, d2);
		}
	}
}